﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
using System.ServiceModel;

namespace SecurityAgent
{
    [ServiceContract]
    interface IProfileProviderService
    {
        [OperationContract]
        [FaultContract(typeof(SecurityFault))]
        [FaultContract(typeof(UnauthorizedAccessFault))]
        int DeleteInactiveProfiles(String applicationKey, string operatorToken, DateTime userInactiveSinceDate);

        [OperationContract]
        [FaultContract(typeof(SecurityFault))]
        [FaultContract(typeof(UnauthorizedAccessFault))]
        int DeleteProfilesByUsername(String applicationKey, string operatorToken, string[] usernames);

        [OperationContract]
        [FaultContract(typeof(SecurityFault))]
        [FaultContract(typeof(UnauthorizedAccessFault))]
        List<ProfileInfo> FindInactiveProfilesByUserName(String applicationKey, string operatorToken, string usernameToMatch, DateTime userInactiveSinceDate, int pageIndex, int pageSize, out int totalRecords);

        [OperationContract]
        [FaultContract(typeof(SecurityFault))]
        List<ProfileInfo> FindProfilesByUserName(String applicationKey, string operatorToken, string usernameToMatch, int pageIndex, int pageSize, out int totalRecords);
        
        [OperationContract]
        [FaultContract(typeof(SecurityFault))]
        [FaultContract(typeof(UnauthorizedAccessFault))]
        List<ProfileInfo> GetAllInactiveProfiles(String applicationKey, string operatorToken, DateTime userInactiveSinceDate, int pageIndex, int pageSize, out int totalRecords);
        
        [OperationContract]
        [FaultContract(typeof(SecurityFault))]
        [FaultContract(typeof(UnauthorizedAccessFault))]
        List<ProfileInfo> GetAllProfiles(String applicationKey, string operatorToken, int pageIndex, int pageSize, out int totalRecords);
        
        [OperationContract]
        [FaultContract(typeof(SecurityFault))]
        [FaultContract(typeof(UnauthorizedAccessFault))]
        int GetNumberOfInactiveProfiles(String applicationKey, string operatorToken, DateTime userInactiveSinceDate);
        
        [OperationContract]
        [FaultContract(typeof(SecurityFault))]
        ProfilePropertyValueCollection GetPropertyValues(String applicationKey, String userToken, String UserName, string[] PropertyNames);

        [OperationContract]
        [FaultContract(typeof(SecurityFault))]
        bool SetPropertyValues(string applicationKey, string userToken, string userName, ProfilePropertyValue[] values);

    }
}
